package com.ruoyi.shaketicket.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.shaketicket.mapper.ShaketicketAwardMapper;
import com.ruoyi.shaketicket.domain.ShaketicketAward;
import com.ruoyi.shaketicket.service.IShaketicketAwardService;
import com.ruoyi.common.support.Convert;

/**
 * 摇一摇奖项 服务层实现
 * 
 * @author lzy
 * @date 2019-03-01
 */
@Service
public class ShaketicketAwardServiceImpl implements IShaketicketAwardService 
{
	@Autowired
	private ShaketicketAwardMapper shaketicketAwardMapper;

	/**
     * 查询摇一摇奖项信息
     * 
     * @param id 摇一摇奖项ID
     * @return 摇一摇奖项信息
     */
    @Override
	public ShaketicketAward selectShaketicketAwardById(String id)
	{
	    return shaketicketAwardMapper.selectShaketicketAwardById(id);
	}
	
	/**
     * 查询摇一摇奖项列表
     * 
     * @param shaketicketAward 摇一摇奖项信息
     * @return 摇一摇奖项集合
     */
	@Override
	public List<ShaketicketAward> selectShaketicketAwardList(ShaketicketAward shaketicketAward)
	{
	    return shaketicketAwardMapper.selectShaketicketAwardList(shaketicketAward);
	}
	
    /**
     * 新增摇一摇奖项
     * 
     * @param shaketicketAward 摇一摇奖项信息
     * @return 结果
     */
	@Override
	public int insertShaketicketAward(ShaketicketAward shaketicketAward)
	{
	    return shaketicketAwardMapper.insertShaketicketAward(shaketicketAward);
	}
	
	/**
     * 修改摇一摇奖项
     * 
     * @param shaketicketAward 摇一摇奖项信息
     * @return 结果
     */
	@Override
	public int updateShaketicketAward(ShaketicketAward shaketicketAward)
	{
	    return shaketicketAwardMapper.updateShaketicketAward(shaketicketAward);
	}

	/**
     * 删除摇一摇奖项对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteShaketicketAwardByIds(String ids)
	{
		return shaketicketAwardMapper.deleteShaketicketAwardByIds(Convert.toStrArray(ids));
	}

	@Override
	public List<ShaketicketAward> queryRemainAwardsByActId(String actId) {
		// TODO Auto-generated method stub
		return shaketicketAwardMapper.queryRemainAwardsByActId(actId);
	}
	
}
